<?php
$this->breadcrumbs = array(
    $model->title,
);
$this->pageTitle = $model->title;
?>

<?php
$this->renderPartial('_view', array(
    'data' => $model,
));
?>

<div id="comments">
    <?php if ($model->commentCount >= 1): ?>
        <?php //echo $model->commentCount>1 ? $model->commentCount . ' comments' : 'One comment'; ?>
        <?php
        $this->renderPartial('_comments', array(
            'post' => $model,
            'comments' => $model->comments,
        ));
        ?>
    <?php endif; ?>

    <h3><?php echo Yii::t('app', 'comment.leaveacomment'); ?></h3>

    <?php if (Yii::app()->user->hasFlash('commentSubmitted')): ?>
        <div class="flash-success">
        <?php echo Yii::app()->user->getFlash('commentSubmitted'); ?>
        </div>
    <?php else: ?>
    <?php
    if(isset($_REQUEST['success']))
        {
        echo $success;        
        }
        foreach(Yii::app()->user->getFlashes() as $key => $message) {
        echo '<div class="flash-' . $key . '">' . $message . "</div>\n";
    }
    $this->renderPartial('/comment/_form', array(
        'model' => $comment,
    ));
    ?>
<?php endif; ?>

</div><!-- comments -->
